package hichecker.ui.components.file_chooser.file_filter;

import hichecker.controller.Config;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public abstract class AbstractFileFilter extends FileFilter {

	@Override
	public boolean accept(File f) {
		return f.isDirectory() || f.getName().matches(".*\\." + getExtension() + "$");
	}

	@Override
	public String getDescription() {
		return Config.PROGRAM_NAME + "-Dateien (*." + getExtension() + ")";
	}
	
	public abstract String getExtension();

}
